﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.Person;

/// <summary>
/// 人员信息
///</summary>
[TableName("person")]
[Description("人员基础信息")]
[PrimaryKey("person_id", AutoIncrement = true)]
[CacheSetting(true)]
[Serializable]
public class PersonInfo : IEntity
{
    /// <summary>
    /// 人员ID
    ///</summary>
    [Column("person_id")]
    public int PersonId { get; set; }

    /// <summary>
    /// 人员姓名
    ///</summary>
    [Column("name")]
    public string Name { get; set; }

    /// <summary>
    /// 身份证号
    /// </summary>
    [Column("card_number")]
    public string CardNumber { get; set; }

    /// <summary>
    /// 性别 1男
    ///</summary>
    [Column("gender")]
    public int? Gender { get; set; }

    /// <summary>
    /// 出生日期
    ///</summary>
    [Column("birthday")]
    public DateTime? Birthday { get; set; }

    /// <summary>
    /// 发证机关
    ///</summary>
    [Column("card_org")]
    public string? CardOrg { get; set; }

    /// <summary>
    /// 证件有效期开始日期
    ///</summary>
    [Column("card_startdate")]
    public DateTime? CardStartdate { get; set; }

    /// <summary>
    /// 证件有效期结束日期
    ///</summary>
    [Column("card_enddate")]
    public DateTime? CardEnddate { get; set; }

    /// <summary>
    /// 婚姻状况 参考婚姻状况字典表
    ///</summary>
    [Column("marital_status")]
    public byte? MaritalStatus { get; set; }

    /// <summary>
    /// 紧急联系人姓名
    ///</summary>
    [Column("urgent_linkman")]
    public string? UrgentLinkman { get; set; }

    /// <summary>
    /// 紧急联系方式
    ///</summary>
    [Column("urgent_linkman_hone")]
    public string? UrgentLinkmanHone { get; set; }

    /// <summary>
    /// 特长
    ///</summary>
    [Column("specialty")]
    public string? Specialty { get; set; }

    /// <summary>
    /// 文化程度 参考文化程度字典表
    ///</summary>
    [Column("culture_level")]
    public byte? CultureLevel { get; set; }

    /// <summary>
    /// 手机号码
    ///</summary>
    [Column("mobile")]
    public string Mobile { get; set; }

    /// <summary>
    /// 身份证上民族信息，如：汉，回，藏等
    ///</summary>
    [Column("nation")]
    public string Nation { get; set; }

    /// <summary>
    /// 住址
    ///</summary>
    [Column("address")]
    public string Address { get; set; }

    /// <summary>
    /// 政治面貌 参考政治面貌字典表
    ///</summary>
    [Column("politics_type")]
    public byte? PoliticsType { get; set; }

    /// <summary>
    /// 加入工会时间。如果加入工会，此字段必填
    ///</summary>
    [Column("joined_time")]
    public DateTime? JoinedTime { get; set; }

    /// <summary>
    /// 是否购买工伤或意外伤害保险 。参考是否字典表
    ///</summary>
    [Column("has_buy_insurance")]
    public bool? HasBuyInsurance { get; set; }

    /// <summary>
    /// 是否有重大病史。参考是否字典表
    ///</summary>
    [Column("has_bad_medical_history")]
    public bool? HasBadMedicalHistory { get; set; }

    /// <summary>
    /// 创建日期
    ///</summary>
    [Column("create_time")]
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 安全Id
    ///</summary>
    [Column("security_id")]
    public int? SecurityId { get; set; }


    #region IEntity 成员

    [Ignore]
    object IEntity.EntityId { get { return this.PersonId; } }

    #endregion IEntity 成员
}